//
// Created by Aivin on 2018/8/8.
//

#ifndef WKPLAYER_WKJAVACALL_H
#define WKPLAYER_WKJAVACALL_H


#include <jni.h>
#include "../config/WkConfig.h"
#include "../utils/WkLoger.h"

class WkJavaCall {
public:
    _JavaVM *javaVM ;
    JNIEnv *jniEnv ;
    jobject  jobj ;

    jmethodID jmid_load ;
    jmethodID jmid_preapared ;
    jmethodID  jmid_error ;
    jmethodID jmid_complate ;
    jmethodID jmid_timeinfo;
    jmethodID jmid_valumedb;
    jmethodID jmie_pcmtoaac;


public :
    WkJavaCall(JavaVM *javaVM , JNIEnv *jniEnv , jobject*  jobj);
    ~WkJavaCall();
    void onCallLoad(int threadType , bool isLoad);
    void onPrepared(int threadType);
    void onCallError(int threadType , int code , char * msg) ;
    void onCallComplate(int threadType);


    void onCallTimeInfo(int type, int curr, int total);
    void onCallValumeDB(int type, int db);
    void onCallPcmToAAc(int type, int size, void *buffer);

};




#endif //WKPLAYER_WKJAVACALL_H
